import config from ".././package.json";
import DdScrollBar from "./DdScrollbar/index.js";
import DdCreateForm from "./DdCreateForm/index.js";
import DdProgress from "./DdProgress/index.js";
import DdTable from "./DdTable/index.js";
import DdFormmatDate from "./DdFormmatDate/index.ts";
import DdmenoyToUpper from "./DdMenoyToUpper/index.ts";
import DdLog from "./DdLog/index.ts";
import DdPrint from "./DdPrintLog/index.ts";
import DdDiaLogDrag from "./DdDiaLogDrag/index.js";
import DdWaterMark from "./DdWaterMark/index.js";
import DdWaterMarkFun from "./DdWaterMark/waterMark.ts";
import DdPie from "./DdPie/index.js";
import DdBar from "./DdBar/index.js";
import DdLine from "./DdLine/index.js";
import DdCircle from "./DdCircle/index.js";
import DdUserCharts from "./DdUserCharts/index.js";
import DdExcel from "./DdExcel/index.ts";
// 导出csv
import DdExportCsv from "./DdExportCsv/index.ts";
// 深拷贝
import DdDeepCopy from "./DdDeepCopy/index.ts";
// 获取字符串字节长度
import DdStrLen from "./DdCheckLength/index.ts";
// cookies 的操作
import DdCookies from "./DdCookies/index.ts";
// 切去字符串 按照字节切去的
import DdCutString from "./DdCutString/index.ts";
// 获取url上的参数
import DdGetRequest from "./DdGetRequest/index.ts";
// 判断是否url
import DdIsUrl from "./DdIsUrl/index.ts";
// 产生随机的颜色
import DdRandomColor from "./DdRandomColor/index.ts";
// 产生随机的字符串
import DdRandomString from "./DdRandomString/index.ts";
// 月数转天数
import DdMon2Day from "./DdMon2Day/index.ts";
// 跑马灯组件
import DdRunLamp from "./DdRunLamp/index.js";
// 字符串转整型
import DdStr2Int from './DdStr2Int/index.ts'
// 字符串的加密与解密
import DdEnDecrypt from './DdEnDecrypt/index.ts'

const install = function(Vue) {
  Vue.component("DdScrollBar", DdScrollBar);
  Vue.component("DdForm", DdCreateForm);
  Vue.component("DdProgress", DdProgress);
  Vue.component("DdTable", DdTable);
  Vue.component("DdPie", DdPie);
  Vue.component("DdBar", DdBar);
  Vue.component("DdLine", DdLine);
  Vue.component("DdCircle", DdCircle);
  Vue.component("DdUserCharts", DdUserCharts);
  Vue.component("DdRunLamp", DdRunLamp);
  Vue.prototype.$DdFormmatDate = DdFormmatDate;
  Vue.prototype.$DdmenoyToUpper = DdmenoyToUpper;
  Vue.prototype.$DdPrint = DdPrint;
  Vue.prototype.$DdLog = DdLog.writeLog;
  Vue.prototype.$DdExcel = DdExcel;
  Vue.prototype.$DdDeepCopy = DdDeepCopy;
  Vue.prototype.$DdStrLen = DdStrLen;
  Vue.prototype.$DdGetCookie = DdCookies.getCookie;
  Vue.prototype.$DdSetCookie = DdCookies.setCookie;
  Vue.prototype.$DdDelCookie = DdCookies.delCookie;
  Vue.prototype.$DdCutStr = DdCutString;
  Vue.prototype.$DdGetUrlParams = DdGetRequest;
  Vue.prototype.$DdIsUrl = DdIsUrl;
  Vue.prototype.$DdRandColor = DdRandomColor;
  Vue.prototype.$DdRandStr = DdRandomString;
  Vue.prototype.$DdWaterMark = DdWaterMarkFun;
  Vue.prototype.$DdExportCsv = DdExportCsv;
  Vue.prototype.$DdMon2Days = DdMon2Day;
  Vue.prototype.$DdStr2Int = DdStr2Int
  Vue.prototype.$DdEncrypt = DdEnDecrypt.encrypt;
  Vue.prototype.$DdDecrypt = DdEnDecrypt.decrypt; 
  Vue.use(DdDiaLogDrag.DdDiaLogDrag);
  Vue.use(DdWaterMark.DdWaterMark);
};
// 可以在js文件中混用require和export。但是不能混用import 以及module.exports。所以这里直接用export default
export default {
  version: config.version,
  install: install,
  DdLog: DdLog,
  DdScrollBar,
  DdCreateForm,
  DdProgress,
  DdTable,
  DdPie,
  DdBar,
  DdLine,
  DdCircle,
  DdUserCharts,
  DdRunLamp,
  // 方法函数  需要在全局 vue.prototype 注册
  DdFormmatDate,
  DdmenoyToUpper,
  DdPrint,
  // DdLog.writeLog,
  DdExcel,
  DdDeepCopy,
  DdStrLen,
  DdCookies,
  DdCutString,
  DdGetRequest,
  DdIsUrl,
  DdRandomColor,
  DdRandomString,
  DdWaterMarkFun,
  DdExportCsv,
  DdMon2Day,
  DdStr2Int,
  // 指令
  DdDiaLogDrag,
  DdWaterMark
};
